package edu.gatech.oad.OTConfig;
import javax.swing.JPanel;
import net.miginfocom.swing.MigLayout;
import javax.swing.JLabel;

/**
 * Panel used for tracking the player's money
 * @author Amy
 *
 */
public class MoneyPanelM6 extends JPanel {

	JLabel lbltotalCost;
	JLabel lblmoneyLeftHere;
	/**
	 * This is the panel for the money stats in the Store
	 * 
	 * @author Amy Lambeth
	 * @version 1.0 10/20/2011
	 */
	
	private static final long serialVersionUID = -886679445876931013L;

	/**
	 * Create the panel.
	 */
	public MoneyPanelM6() {
		setLayout(new MigLayout("", "[141.00][152.00]", "[][]"));
		
		JLabel lblTotalCost = new JLabel("Total Cost:");
		add(lblTotalCost, "cell 0 0");
		
		lbltotalCost = new JLabel("0");
		add(lbltotalCost, "cell 1 0");
		
		JLabel lblMoneyLeft = new JLabel("Money Left:");
		add(lblMoneyLeft, "cell 0 1");
		
		lblmoneyLeftHere = new JLabel("1600");
		add(lblmoneyLeftHere, "cell 1 1");
		
		
	}
	
	/**
	 * Updates the cost of the current purchase
	 * @param newCost The cost of the current purchase
	 */
	public void updateCost(int newCost){
		lbltotalCost.setText("" + newCost);
	}
	
	/**
	 * Tracks the user's remaining money
	 * @param moneyLeft The user's remaining money
	 */
	public void updateMoneyLeft(int moneyLeft){
		lblmoneyLeftHere.setText("" + moneyLeft);	
	}
	
	public String getCost(){
		return lbltotalCost.getText();
	}
	
	public String getMoneyLeft(){
		return lblmoneyLeftHere.getText();
	}
}
